/*
* $Id: ServiceDeleteOperation.h 335 2011-09-22 20:12:12Z volok-aleksej@yandex.ru $
*
* Copyright 2009-2011 by Volokitin Aleksey
* All rights reserved
*
*/
#ifndef _SERVICE_DELETE_OPERATION_H_
#define _SERVICE_DELETE_OPERATION_H_

#include "Database/InterfaceDb.h"
#include "Database/Operation/DeleteOperation.h"

class CTransactManager;

class CServiceDeleteOperation : public IServOperation
{
	CTransactManager* m_pManager;
	CDeleteOperation::content::type m_type;
	std::tstring m_lastOperationLog;
public:
	CServiceDeleteOperation(CTransactManager* pManager, CDeleteOperation::content::type type);
	~CServiceDeleteOperation();
public:
	virtual std::tstring ExecuteOperation(IDatabase* pDatabase, IReader* pReader);
	virtual void Free();
private:
	void DeleteQueenBee(IDatabase* pDatabase, int id);
	void DeletePoint(IDatabase* pDatabase, int id);
	void DeleteFamily(IDatabase* pDatabase, int id);
	void DeleteJournal(IDatabase* pDatabase, int id);
	void DeleteHousing(IDatabase* pDatabase, int id);
};

#endif/*_SERVICE_DELETE_OPERATION_H_*/